@using System.Reflection;
@inject IStringLocalizer<Resource> _localizer
@model MainModel


<nav class="header-nav d-flex">
  <!-- Topics -->
  @if (Model.Main.Categories.Any())
  {
    <div class="dropdown me-auto me-md-0">
      <button class="header-nav-link" type="button" id="mainNav" data-bs-toggle="dropdown" aria-expanded="false">
        <span class="me-1">@_localizer["categories"]</span>
        <svg width="16" height="16" class="bi bi-chevron-down">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#categories"></use>
        </svg>
      </button>
      <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="mainNav">
        @{
          var categoryUrl = Url.Content("~/category");
          foreach (var item in Model.Main.Categories)
          {
            <li><a class="dropdown-item" href="@categoryUrl/@item.Category">@item.Category</a></li>
          }
        }
      </ul>
    </div>
  }
  <!--/Topics -->
  <!-- Social -->
  <ul class="social d-flex ms-2" aria-label="@_localizer["social-accounts"]">
    <li>
      <a class="social-link-github header-nav-button" href="https://github.com/" target="_blank" aria-label="@_localizer["github"]">
        <svg width="16" height="16" class="bi bi-github">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#github"></use>
        </svg>
      </a>
    </li>
    <li>
      <a class="social-link-twitter header-nav-button" href="https://twitter.com/" target="_blank" aria-label="@_localizer["twitter"]">
        <svg width="16" height="16" class="bi bi-twitter">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#twitter"></use>
        </svg>
      </a>
    </li>
    <li>
      <a class="social-link-facebook header-nav-button" href="https://facebook.com" target="_blank" aria-label="@_localizer["facebook"]">
        <svg width="16" height="16" class="bi bi-facebook">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#facebook"></use>
        </svg>
      </a>
    </li>
    <li>
      <a class="social-link-youtube header-nav-button" href="https://youtube.com/" target="_blank" aria-label="@_localizer["youtube"]">
        <svg width="16" height="16" class="bi bi-youtube">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#youtube"></use>
        </svg>
      </a>
    </li>
    <li>
      <a class="social-link-instagram header-nav-button" href="https://instagram.com/" target="_blank" aria-label="@_localizer["instagram"]">
        <svg width="16" height="16" class="bi bi-instagram">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#instagram"></use>
        </svg>
      </a>
    </li>
  </ul>
  <!--/social -->
  <!-- Search button -->
  <button aria-label="@_localizer["search"]" class="header-nav-button d-none d-md-block" type="button" data-bs-toggle="modal" data-bs-target="#searchModal">
    <svg width="16" height="16" class="bi bi-search">
      <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#search"></use>
    </svg>
  </button>
  <!--/Search button -->
  <!-- Admin Menu -->
  @if (Model.Main.Claims != null)
  {
    <div class="dropdown">
      <button class="header-nav-link -login ms-4" title="@_localizer["login"]" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Admin Menu - John">
        <span class="me-1 d-none d-md-inline">@Model.Main.Claims.NickName</span>
        <svg width="16" height="16" class="bi bi-chevron-down">
          <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#chevron-down"></use>
        </svg>
      </button>
      <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuButton">
        <li><a class="dropdown-item" href="~/admin/">@_localizer["dashboard"]</a></li>
        <li><a class="dropdown-item" href="~/admin/newsletter/">@_localizer["newsletter"]</a></li>
        <li><a class="dropdown-item" href="~/admin/settings/">@_localizer["settings"]</a></li>
        <li><a class="dropdown-item" href="~/admin/settings/customize/">@_localizer["customize"]</a></li>
        <li><a class="dropdown-item" href="~/account/profile?redirecturi=@Model.Main.PathUrl">@_localizer["account-profile"]</a></li>
        <li>
          <hr class="dropdown-divider">
        </li>
        <li><a class="dropdown-item" href="~/account/logout">@_localizer["logout"]</a></li>
      </ul>
    </div>
  }
  else
  {
    <a class="header-nav-button -login ms-4" href="~/account" title="@_localizer["login"]" aria-label="@_localizer["login"]" role="button">
      <svg width="20" height="20" class="bi bi-box-arrow-in-right">
        <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#box-arrow-in-right"></use>
      </svg>
    </a>
  }
  <!--/Admin Menu -->
</nav>
